package com.gaohe.post.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.post.mapper.FmPostViewMapper;
import com.gaohe.post.domain.FmPostView;
import com.gaohe.post.service.IFmPostViewService;

/**
 * 帖子围观Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmPostViewServiceImpl implements IFmPostViewService 
{
    @Autowired
    private FmPostViewMapper fmPostViewMapper;

    /**
     * 查询帖子围观
     * 
     * @param postViewId 帖子围观主键
     * @return 帖子围观
     */
    @Override
    public FmPostView selectFmPostViewByPostViewId(Long postViewId)
    {
        return fmPostViewMapper.selectFmPostViewByPostViewId(postViewId);
    }

    /**
     * 查询帖子围观列表
     * 
     * @param fmPostView 帖子围观
     * @return 帖子围观
     */
    @Override
    public List<FmPostView> selectFmPostViewList(FmPostView fmPostView)
    {
        return fmPostViewMapper.selectFmPostViewList(fmPostView);
    }

    /**
     * 新增帖子围观
     * 
     * @param fmPostView 帖子围观
     * @return 结果
     */
    @Override
    public int insertFmPostView(FmPostView fmPostView)
    {
        fmPostView.setCreateTime(DateUtils.getNowDate());
        return fmPostViewMapper.insertFmPostView(fmPostView);
    }

    /**
     * 修改帖子围观
     * 
     * @param fmPostView 帖子围观
     * @return 结果
     */
    @Override
    public int updateFmPostView(FmPostView fmPostView)
    {
        fmPostView.setUpdateTime(DateUtils.getNowDate());
        return fmPostViewMapper.updateFmPostView(fmPostView);
    }

    /**
     * 批量删除帖子围观
     * 
     * @param postViewIds 需要删除的帖子围观主键
     * @return 结果
     */
    @Override
    public int deleteFmPostViewByPostViewIds(Long[] postViewIds)
    {
        return fmPostViewMapper.deleteFmPostViewByPostViewIds(postViewIds);
    }

    /**
     * 删除帖子围观信息
     * 
     * @param postViewId 帖子围观主键
     * @return 结果
     */
    @Override
    public int deleteFmPostViewByPostViewId(Long postViewId)
    {
        return fmPostViewMapper.deleteFmPostViewByPostViewId(postViewId);
    }
}
